package com.inspur.edp.web.formmetadata.i18n.component.strategy.i18nresourcestrategy;

import com.inspur.edp.lcm.metadata.api.entity.I18nResourceItem;
import com.inspur.edp.lcm.metadata.api.entity.I18nResourceItemCollection;
import com.inspur.edp.web.common.utility.StringUtility;
import com.inspur.edp.web.formmetadata.i18n.I18nResourceItemManager;
import com.inspur.edp.web.formmetadata.i18n.component.ComponentUtility;
import com.inspur.edp.web.formmetadata.i18n.component.strategy.i18nresourcestrategy.CommonStrategy.GridCommonStrategy;

import java.util.HashMap;
import java.util.List;

public class TreeGridI18nResourceStrategy extends GridCommonStrategy {
    @Override
    protected I18nResourceItemCollection extractAttributeI18nResourceItemCollection(String i18nResourceItemBaseId, HashMap<String, Object> currentComponent) {
        I18nResourceItemCollection i18nResourceItemCollection = new I18nResourceItemCollection();
        //提取TreeGrid 的操作列
        I18nResourceItemCollection operateButtonResourceItemCollection = ExtractComponentOperateButtonI18nResourceItemCollection(i18nResourceItemBaseId, currentComponent);
        if (operateButtonResourceItemCollection != null && operateButtonResourceItemCollection.size() > 0) {
            i18nResourceItemCollection.addRange(operateButtonResourceItemCollection);
        }
        if(currentComponent.containsKey("columns")){
            I18nResourceItemCollection columnsI18nResourceItemCollection=extractedColumns( i18nResourceItemBaseId, currentComponent);
            if (columnsI18nResourceItemCollection != null && columnsI18nResourceItemCollection.size() > 0) {
                i18nResourceItemCollection.addRange(columnsI18nResourceItemCollection);
            }
        }
        return i18nResourceItemCollection;
    }
}
